home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / March 96 / Re Setting Context < prev    next >
Encoding:
Internet Message Format  |  1996-12-03  |  3.7 KB  |  [TEXT/ttxt]

  1. Subject:     Re: Setting Context
  2. Sent:        3/11/96 9:03 AM
  3. Received:    3/11/96 9:11 AM
  4. From:        lamiraux@apple.com
  5. Reply-To:    ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. >Henri & team,
  9. >I have a part which is based on ODF Draw (d11).  Within my content view,
  10. >I've embedded some subframes.
  11. >
  12. >I'm trying to understand the correct way to set the context so I can render
  13. >within these subframes.  I've tried using FW_CViewContext,
  14. >FW_CFacetContext, and FW_CPlatformGraphicContext (individually, of course).
  15. >I want to set the context and then render within the frame using a mix of
  16. >ODF rendering methods and native calls.  I would expect that after setting
  17. >the context, my rendering would be clipped to the subframe and all of my
  18. >rendering would also be relative to the subframe (nominally the topLeft
  19. >corner).
  20. >
  21. >Here's what I experienced using the above-listed contexts within the
  22. >subframe's draw methods:
  23. >  FW_CViewContext
  24. >    Native calls : rendering was relative to window's origin.
  25. >    ODF          : rendering was relative to contentview origin.
  26. >    Clipping     : clipped to frame, but if content view is scrolled,
  27. >overwrites scrollers & rulers.
  28. >  FW_CFacetContext
  29. >    Native calls : rendering was relative to window's origin.
  30. >    ODF          : rendering was relative to contentview origin
  31. >    Clipping     : didn't clip.  If scrolled, ODF calls were offset as
  32. >expected, but native calls still were relative to window origin.
  33. >  FW_CPlatformGraphicContext
  34. >    Native calls : rendering was relative to contentview origin
  35. >    ODF          : rendering was relative to contentview origin
  36. >    Clipping     : clipped to frame, but if content view is scrolled,
  37. >overwrites scrollers & rulers.
  38. >
  39. >>From my experimentation it looks like   FW_CPlatformGraphicContext is the
  40. >only case where ODF rendering and native rendering calls are in
  41. >registration with one another.  However, even using
  42. >FW_CPlatformGraphicContext, I still have to clip out the rulers and
  43. >scrollers myself, and do a transformation to convert my coordinates from
  44. >frame coordinates to contentview-relative.
  45. >
  46. >Do I need to make another call to correctly set up the transform?  I had
  47. >assumed these calls would set up the transform for me; either they don't,
  48. >or something's wrong with my subframe.
  49. >
  50. >I would appreciate any additional explanation which you feel would help me
  51. >better understand the relationship between these three calls, and the
  52. >context in which each should be used.  (I've read both chapter 7 in the ODF
  53. >Developers Guide and the ODF View System document, provided with d11)
  54. >
  55. >Regards,
  56. >
  57. >Gary Ashcraft
  58. >ashcraft@itsnet.com
  59.  
  60. FW_CViewContext and FW_CFacetContext (which is gone in our next release, 
  61. FW_CViewContext replacing it) assume your are going to use the ODF 
  62. Graphics. FW_CPlatformContext assumes your are going to use native calls. 
  63. You cannot mix. FW_CPlatformContext just changes the grafport origin to 
  64. reflect the facet position, it is very similar to CFocus from the OpenDoc 
  65. utilities. FW_CViewContext leaves the origin to (0,0) and cache a 
  66. transform to transform shapes so they can be drawn at the right place. 
  67. Now, both of them should respect the clip set up by the containing frame. 
  68. Unless we have a bug, you should not be allow to draw ontop of the rulers 
  69. using FW_CPlatformContext. The clip of your embedded facets is set up by 
  70. the container. The container doesn't know if its embedded facets are 
  71. going to use a FW_CViewContext or a FW_CPlatformContext (I assume here 
  72. that you (the container) is not trying to draw inside its embedded facets 
  73. - this is illegal). Using a FW_CViewContext and ODF Graphic or a 
  74. FW_CPlatformContext and Quickdraw should have the same result. 
  75.